def print_calendar(year):
    days_per_month = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] # 此处二月为28天
    month_names = ["January", "February", "March", "April", "May", "June",
                   "July", "August", "September", "October", "November", "December"]
    weekdays = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"]
    first_days_of_month = [4, 0, 3, 6, 2, 4, 6, 1, 3, 6, 2, 4]

    print("2021")
    print("\n" + " " * 24, end="")

    for i in range(12):
        print(f"\n{' ' * (6 - len(str(i + 1)) * 2)}{i + 1:2d} {month_names[i]:<20}", end="")

        for wd in weekdays:
            print(f"{wd:3s}", end=" ")
        print()

        current_day = 1
        week_line = []
        for weekday_index in range(first_days_of_month[i], first_days_of_month[i] + days_per_month[i]):
            if weekday_index % 7 == 0 and weekday_index!= first_days_of_month[i]:
                week_line = [0]*(7 - len(week_line))+week_line
                print(" ".join(f"{day:2d}" for day in week_line))
                week_line = []
            if weekday_index < first_days_of_month[i] + days_per_month[i]:
                week_line.append(current_day)
                current_day += 1

        if week_line:
            week_line = [0]*(7 - len(week_line))+week_line
            print(" ".join(f"{day:2d}" for day in week_line))
            
print_calendar(2021)